<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html; charset=UTF-8" language="java"
	import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="/Web/common/page/jqueryMaster.jsp"%>
<%
	String currentUsername = "";
	if( null == user){
		String url = root + "/common/toLoginPage.jhtml";
		response.sendRedirect(url);
	} else {
		currentUsername = user.getUsername();
	}
%>
<html>
<head>
<script type="text/javascript" src="<%=root%>/Web/user/js/user.js"></script>
<script type="text/javascript">
var currentUsername = '<%=currentUsername%>';
function setFilePath( username ){
	$('#userInfoAdd_filepath').val("C:\\tmp\\search_" + username +".txt");
}
</script>
<style type="text/css">
#readonlyText{
	
}
</style>
</head>

<body>
	<!-- 表格 -->
	<table 	id="userInfoTable"
		title="用户信息一览"  
		border="0"
		cellspacing="0"
		cellpadding="0"
		iconCls="icon-edit" 
		idField="username" 
		pagination="true"
		remoteSort="false" 
		singleSelect="false" 
		showFooter="false"
		striped="true" 
		url="<%=root %>/user/doLoadUsers.jhtml">
		<thead>
			<tr align="center">
				<th field="id" checkbox="true" width="20"></th>
				<th field="username" width="100">用户名</th>
				<th field="filepath" width="150">查询文件路径</th>
				<th field="opt" formatter='optFormater' align = "center" width="150">操作</th>
			</tr>
		</thead>
	</table>

	<div id="userInfoAdd" icon="icon-save" style="padding: 5px; width: 400px; height: 250px;">
		<h5 id="userInfoAdd_message" style="color: red;"></h5>
		<table id="table_userInfoAdd" onkeydown="if(event.keyCode==13){userInfoAdd();}">
			<tr>
				<td align="right"><b style="font: 12px">用户名：</b></td>
				<td>
					<input type="text" class="easyui-validatebox" id="userInfoAdd_username" onblur= "setFilePath( this.value );" style="width:200px;" maxlength="20" required="true"></input>
				</td>
			</tr>
			<tr>
				<td align="right"><b style="font: 12px">密码：</b></td>
				<td><input type="password" class="easyui-validatebox" id="userInfoAdd_password" style="width:200px;" maxlength="20" required="true"></input></td>
			</tr>
			<tr>
				<td align="right"><b style="font: 12px">重复密码：</b></td>
				<td><input type="password" class="easyui-validatebox" id="userInfoAdd_repassword" style="width:200px;" maxlength="20" required="true"></input></td>
			</tr>
			<tr>
				<td align="right"><b style="font: 12px">查询文件路径：</b></td>
				<td><input type="text" class="easyui-validatebox" id="userInfoAdd_filepath" style="width:200px;background:#CCCCCC" maxlength="20" readonly></input></td>
			</tr>
			<tr>
				<td colspan="2" align="center">
					<a href="#" class="easyui-linkbutton" icon="icon-ok" onclick="userInfoAdd();">提交</a>
					<a href="#" class="easyui-linkbutton" icon="icon-redo" onclick="userInfoAddReset();">重置</a>
				</td>
			</tr>
		</table>
	</div>
	
	<div id="userInfoEdit" icon="icon-save" style="padding: 5px; width: 400px; height: 250px;">
		<h5 id="userInfoEdit_message" style="color: red;"></h5>
		<table id="table_userInfoEdit" onkeydown="if(event.keyCode==13){userInfoEdit();}">
			<tr>
				<td align="right"><b style="font: 12px">用户名：</b></td>
				<td><input type="text" class="easyui-validatebox" id="userInfoEdit_username" style="width:200px;background:#CCCCCC" maxlength="20" readonly></input></td>
			</tr>
			<tr>
				<td align="right"><b style="font: 12px">密码：</b></td>
				<td><input type="password" class="easyui-validatebox" id="userInfoEdit_password" style="width:200px;" maxlength="20" required="true"></input></td>
			</tr>
			<tr>
				<td align="right"><b style="font: 12px">重复密码：</b></td>
				<td><input type="password" class="easyui-validatebox" id="userInfoEdit_repassword" style="width:200px;" maxlength="20" required="true"></input></td>
			</tr>
			<tr>
				<td align="right"><b style="font: 12px">查询文件路径：</b></td>
				<td><input type="text" class="easyui-validatebox" id="userInfoEdit_filepath" style="width:200px;background:#CCCCCC" maxlength="20" readonly></input></td>
			</tr>
			<tr>
				<td colspan="2" align="center">
					<a href="#" class="easyui-linkbutton" icon="icon-ok" onclick="userInfoEdit();">提交</a>
					<a href="#" class="easyui-linkbutton" icon="icon-redo" onclick="userInfoEditReset($('#userInfoEdit_username').val());">重置</a>
				</td>
			</tr>
		</table>
	</div>
</body>
</html>
